<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
        box-sizing: border-box;
      }
      body {
        background-color: #000;
      }
      .container {
        background-color: #0c2d59;
        width: 1920px;
        height: 1080px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform-origin: 0 0;
        color: #fff;
      }
      header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px;
      }
      header h1,
      header h2 {
        font-size: 18px;
        font-weight: bold;
      }
      main {
        display: flex;
        height: 100%;
      }
      main .left {
        flex: 0 0 20%;
      }
      main .content {
        flex: 1;
      }
      main .right {
        flex: 0 0 20%;
      }
    </style>
    <script src="../echarts.js"></script>
  </head>
  <body>
    <div class="container">
      <header>
        <h1>水质情况实时监测预警系统</h1>
        <h2>2021年09月11日 10:40:17 星期六</h2>
      </header>
      <main>
        <div class="left"></div>
        <div class="content"></div>
        <div class="right"></div>
      </main>
    </div>
  </body>
</html>
<script>
  function scale() {
    const width = 1920;
    const height = 1080;

    const domWidth = document.documentElement.clientWidth;
    const domHeight = document.documentElement.clientHeight;

    const scale = Math.min(domWidth / width, domHeight / height);

    const container = document.querySelector(".container");
    container.style.transform = `scale(${scale}) translate(-50%,-50%)`;
  }
  scale();
  window.addEventListener("resize", scale);
</script>
